package cn.lx.expansion.dynamic2;

import java.lang.reflect.InvocationHandler;

/**
 * @author lixin
 * @Classname Client
 * @Description TODO
 * @Date 2019/10/5 下午4:22
 */
public class Client {
    public static void main(String[] args) {
      /*  Subject subject = new RealSubject();

        InvocationHandler invocationHandler = new MyInvocationHandler(subject);

        Subject proxy = DynamicProxy.newProxyInstance(subject.getClass().getClassLoader(), subject.getClass().getInterfaces(),
                invocationHandler);

        proxy.doSomething("lixin");*/

        Subject subject = new RealSubject();

        Subject proxy = SubjectDynamicProxy.newProxyInstance(subject);
        proxy.doSomething("lxiin");

    }
}
